<?php echo $this->category_model->genTree(0, 0, true, $this->manga_model->getCategoryIds()); ?>
<script language="javascript" type="text/javascript">
	jQuery(".categoryItem input:checkbox").click(function() {
		var checked = jQuery(this).attr("checked");
		var children = jQuery(this).parent().find("ul li input:checkbox");
		if (checked) {
			jQuery(children).each(function() {
				jQuery(this).attr("checked", "checked");
			});
		} else {
			jQuery(children).each(function() {
				jQuery(this).attr("checked", "");
			});
		}
	});
</script>